/**
 * Created by Administrator on 2017/6/30.
 */
$(function () {
  $('#doubanMovieId').on('blur', function () {
    var doubanId = $('#doubanMovieId').val();
    if (doubanId.length == 0) {
      return;
    }
    $.ajax({
      type: 'GET',
      url: 'http://api.douban.com/v2/movie/subject/' + doubanId,
      dataType: 'jsonp',
      success: function (data) {
        console.log(data);
        $('#movieName').val(data.title);
        $('#movieDirector').val(data.directors[0].name);
        $('#movieYear').val(data.year);
        $('#moviePoster').val(data.images.large);
        $('#moviePlay').val(data.mobile_url);
        $('#movieSummary').val(data.summary);
      }
    });
  })
});